﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KendoMvcUI.Core;
using KendoMvcUI.Common;
using System.Web.Mvc;

namespace KendoMvcUI.UI
{
    public class Slider:KendoUIBase
    {
        public Slider(KendoUIControlSettings settings,ViewContext context,IViewDataContainer container)
            :base(settings,context,container)
        { }
    }
    public class SliderSettings : KendoUIControlSettings
    {
        public SliderSettings()
            : base("kendoSlider")
        { }
        /// <summary>
        /// default: "Decrease"
        /// </summary>
        public string DecreaseButtonTitle { get; set; }
        /// <summary>
        /// default: "Increase"
        /// </summary>
        public string IncreaseButtonTitle { get; set; }
        /// <summary>
        /// default: 5
        /// </summary>
        public int? LargeStep { get; set; }
        public int? Max { get; set; }
        public int? Min { get; set; }
        /// <summary>
        /// The orientation of a Slider: "horizontal" or "vertical".
        /// </summary>
        public string Orientation { get; set; }
        public bool? showButtons { get; set; }
        public int? SmallStep { get; set; }
        /// <summary>
        /// "topLeft","bottomRight","both","none"
        /// </summary>
        public string TickPlacement { get; set; }
        public int? Value { get; set; }
        [PropertySetting(IsIngoreForJavaScript = true)]
        public Action<TooltipSettings> Tooltip { get; set; }

        #region 事件
        public string On_Change { get; set; }
        public string On_Slide { get; set; }
        #endregion

        public override string ToJsSettings()
        {
            var js = base.ToJsSettings();
            if (!js.EndsWith(","))
                js += ",";
            if (Tooltip != null)
            {
                TooltipSettings tooltip = new TooltipSettings();
                Tooltip(tooltip);
                js += tooltip.ToString() + ",";
            }
            return js.TrimEnd(',');
        }
    }
}
